package util

import "net/http"

// 将http的cookies转换成map对象
func GetCookiesToMap(cookies []*http.Cookie) map[string]string {
	data := make(map[string]string)

	for k, _ := range cookies {
		name := cookies[k].Name
		value := cookies[k].Value

		data[name] = value
	}

	return data
}


// 设置cookie
func SetCookie(name, value string) *http.Cookie {
	return &http.Cookie{
		Name:       name,
		Value:      value,
	}
}